package com.cloud.yidiandao.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author pudding lin
 * @date 2021/1/9 15:50
 */
public class TimeUtil {
    /**
     * 获取当前时间
     * @return
     */
    public static String getTime(){
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
    }

    /**
     * 获取指定分钟后的日期*/
    public static Date addMinute(int m){
        Calendar calendar=Calendar.getInstance();
        calendar.add(Calendar.MINUTE,m);
        return calendar.getTime();
    }
}
